package gs.wicket.app.index;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.PropertyModel;

import gs.wicket.app.base.BasePage;

public class IndexPage extends BasePage{

	private int daInt = 0;
	private int neInt = 0;
	public IndexPage() {
		super();
		add(new Label("index.page.question",getLangProperty("index.page.question")));
		//brojaci
		final Label da = new Label("da", new PropertyModel(this, "daInt"));
        da.setOutputMarkupId(true);
        add(da);
        

        final Label ne = new Label("ne", new PropertyModel(this, "neInt"));
        ne.setOutputMarkupId(true);
        add(ne);
        
        add(new AjaxFallbackLink("da-link")
        {
         
			private static final long serialVersionUID = 1L;

			@Override
            public void onClick(AjaxRequestTarget target)
            {
				
                daInt++;
                if (target != null)
                {
                    target.addComponent(da);
                }
            }
        });
        
        add(new AjaxFallbackLink("ne-link")
        {
         
			private static final long serialVersionUID = 1L;

			@Override
            public void onClick(AjaxRequestTarget target)
            {
                neInt++;
                if (target != null)
                {
                    target.addComponent(ne);
                }
            }
        });
        
        add(new Label("index.page.welcome",getLangProperty("index.page.welcome")));
        add(new Label("index.page.message.first",getLangProperty("index.page.message.first")));
        add(new Label("index.page.message.second",getLangProperty("index.page.message.second")));
        add(new Label("index.page.message.third",getLangProperty("index.page.message.third")));

}}